package org.mv.mm.common.actions;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.mv.mm.common.ILinkedWindow;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.awt.ActionRegistration;
import org.openide.util.NbBundle.Messages;

@ActionID(category = "LinkedWindow",
id = "org.mv.mm.common.actions.ShowParentAction")
@ActionRegistration(iconBase = "org/mv/mm/common/actions/icon_show_parent.png",
displayName = "#CTL_ShowParentAction")
@ActionReferences({
  @ActionReference(path = "Menu/View", position = 0, separatorAfter = 50),
  @ActionReference(path = "Toolbars/File", position = 544)
})
@Messages("CTL_ShowParentAction=Show linked parent window")
public final class ShowParentAction implements ActionListener {

  private final ILinkedWindow context;

  public ShowParentAction(ILinkedWindow context) {
    this.context = context;
  }

  @Override
  public void actionPerformed(ActionEvent ev) {
    context.showParent();
  }
}
